﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Synchronization.Data;

namespace SyncLib.Data
{
    public class KPSyncTableProgress
    {

        public int ChangesApplied { get; set; }
        public int ChangesFailed { get; set; }
        public int Deletes { get; set; }
        public int Inserts { get; set; }
        public int Updates { get; set; }
        public string TableName { get; set; }
        public int TotalChanges { get; set; }
        public Dictionary<string, KPSyncTableProgress> DependencyTables { get; set; }
        public List<ConflictData> Conflicts { get; set; }
        public KPSyncTableProgress()
        {
            DependencyTables = new Dictionary<string, KPSyncTableProgress>();
            Conflicts = new List<ConflictData>();
        }
        public void MergeSyncTableProgress(SyncTableProgress tableProcess)
        {
            if (TableName == tableProcess.TableName)
            {
                ChangesApplied = tableProcess.ChangesApplied;
                ChangesFailed = tableProcess.ChangesFailed;
                Deletes = tableProcess.Deletes;
                Inserts = tableProcess.Inserts;
                Updates = tableProcess.Updates;
                TotalChanges = tableProcess.TotalChanges;
            }
        }

    }
}
